import { ogImage, OG_SIZE, OG_CONTENT_TYPE } from '@/lib/og'; import { getGeneBySymbol } from '@/lib/queries/genomics'; import { fmtInt } from '@/lib/format'; export const alt = 'CancerIndex gene page'; export const size = OG_SIZE; export const contentType = OG_CONTENT_TYPE; export const revalidate = 3600; export default async function Image({ params }: { params: Promise<{ symbol: string }> }) { const { symbol } = await params; const g = await getGeneBySymbol(symbol); if (!g) return ogImage({ kicker: 'Gene', title: 'Gene not found', subtitle: symbol }); const facts = [ g.evidence_count ? { label: 'curated evidence items', value: fmtInt(g.evidence_count) } : null, g.variant_count ? { label: 'variants', value: fmtInt(g.variant_count) } : null, g.cohort_count ? { label: 'genomic cohorts', value: fmtInt(g.cohort_count) } : null, ].filter((f): f is { label: string; value: string } => !!f); return ogImage({ kicker: `Gene${g.hgnc_id ? ` · ${g.hgnc_id}` : ''}${g.is_cancer_gene ? ' · cancer gene' : ''}`, title: g.symbol, subtitle: g.name ?? 'Curated cancer evidence, variants and cohort alteration frequencies.', facts, sourcesNote: 'HGNC · CIViC · ClinVar · GDC · cBioPortal', }); }